package com.qiku.controller;

import com.qiku.domin.Test;
import com.qiku.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping("/findAll")
    public String findAll(Model model){
        List<Test> all = testService.findAll();
        model.addAttribute("list" , all);
        return "test";
    }

}
